﻿@using System.Text
@using OA.Model
@using OA.AspNetCore.Html
@using OA.Core.Model
@using OA.Core.Helper

@model OA.Model.Employee
@{
    ViewBag.Title = "职员信息";
    Layout = "~/Areas/Member/Views/Shared/_form_layout.cshtml";

    string msg = ViewBag.Msg;
    string tips = string.Empty;
    if (!string.IsNullOrWhiteSpace(msg))
    {
        tips = $"layer.msg('{msg}');";
    }

    List<ListItem> positionLevels = ViewBag.PositionLevel;

}
<link rel="stylesheet" type="text/css" href="@ViewBag.OssUrl/front/webuploader/webuploader.css">
<script type="text/javascript" src="@ViewBag.OssUrl/front/webuploader/webuploader.min.js"></script>
<script type="text/javascript" src="@ViewBag.OssUrl/front/js/common.js"></script>
<script type="text/javascript">
    currentUrl = "/Management/Employee/Show?empID=@Model.EmpID";
</script>
<div class="layui-my-content">
    <div class="myForm">
        @using (Html.BeginForm(FormMethod.Post, htmlAttributes: new { @class = "layui-form", id = "myForm" }))
        {
            @Html.AntiForgeryToken()
            <div class="layui-form-item">
                @Html.LabelFor(model => model.EmpID, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.HiddenFor(model => model.ID)
                    @Html.MyEditorFor(model => model.EmpID)
                </div>
            </div>
            <div class="layui-form-item">
                @Html.LabelFor(model => model.EmpName, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.EmpName)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.EmpName_PY, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.EmpName_PY)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Pic, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Pic)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.HireDate, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.HireDate)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Sex, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Sex)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Nation, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Nation)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Birthday, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Birthday)
                </div>
            </div>



            <div class="layui-form-item">
                @Html.LabelFor(model => model.Address, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Address)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.NUEE, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.NUEE)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Marriage, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Marriage)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Height, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Height)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Politics, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Politics)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.JoinTime, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.JoinTime)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Organization, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Organization)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.HighestEducation, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.HighestEducation)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.EducationType, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.EducationType)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.GraduationDate, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.GraduationDate)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Specialty, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Specialty)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.School, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.School)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.SID, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.SID)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Telephone, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Telephone)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.TelIsSecrecy, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.TelIsSecrecy)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Referrer, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Referrer)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Email, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Email)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.OtherDescription, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.OtherDescription)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.TelSimpleNum, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.TelSimpleNum)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Honor, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Honor)
                </div>
            </div>
            <div class="layui-form-item">
                @Html.LabelFor(model => model.PositionLevel, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.PositionLevel, positionLevels)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.VirtualPositionLevel, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.VirtualPositionLevel, positionLevels)
                </div>
            </div>

            <div class="layui-form-item">
                @Html.LabelFor(model => model.Sort, new { @class = "layui-form-label" })
                <div class="layui-input-block">
                    @Html.MyEditorFor(model => model.Sort)
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="submit" value="提 交" lay-submit="" lay-filter="OAForm" class="layui-btn mySubmit" />
                </div>
            </div>
        }
    </div>
</div>
<script type="text/javascript">
    layui.use(['form', 'layedit', 'element','layer'], function () {
		form = layui.form;
        layer = layui.layer;
        element = layui.element;
        form.verify({
            C_Sex: function (value, item) {
                if ($("input[name='Sex']:checked").length == 0) {
                    return '请选择性别';
                }
            },
            C_Marriage: function (value, item) {
                if ($("input[name='Marriage']:checked").length == 0) {
                    return '请选择婚姻状态';
                }
            },
            C_Politics: function (value, item) {
                if ($("input[name='Politics']:checked").length == 0) {
                    return '请选择政治面貌';
                }
            },
            C_HighestEducation: function (value, item) {
                if ($("input[name='HighestEducation']:checked").length == 0) {
                    return '请选择最高学历';
                }
            },
            C_EducationType: function (value, item) {
                if ($("input[name='EducationType']:checked").length == 0) {
                    return '请选择毕业证类型';
                }
            },
        }); 
    });
</script>
